home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
yerk 3.66
/
System source
/
objInit
< prev
next >
Wrap
Text File
|
1994-06-24
|
2KB
|
65 lines
\ objInit words for Yerk
\ 1/07/86 cdn Split from Window
\ 8/06/86 cdn Eliminated actFW; never liked it anyway
\ 10/25/91 rfl moved screenbits to window
\ added setscroll to sysinit, and grayrgn
\ 6/08/93 rfl split sysinit up to two words..eventInit added for compile needs
\ 2/08/94 rfl changed purge in eventInit to purge!, to force modules marked
\ as locked to be purged at startup
\ ( -- addr len ) leave name of the startup document as a string
: myDoc finfo 12 + count ;
\ set appropriate state when fWind is activated
\ : actFW Decimal initfont ;
: eventInit
$ c1ef set: fEvent \ set for all events except autokey
<[ 4 ]> 'cfas null-evt mouse-evt null-evt key-evt
<[ 4 ]> 'cfas null-evt key-evt upd-evt disk-evt
<[ 4 ]> 'cfas actv-evt null-evt null-evt null-evt
<[ 4 ]> 'cfas null-evt null-evt null-evt OS-Evt
<[ 4 ]> 'cfas null-evt null-evt null-evt null-evt
<[ 3 ]> 'cfas null-evt null-evt HL-Evt
put: fEvent
purge! rekey +curs ;
\ Define system startup word that initializes all nucleus
\ objects - fFcb, fEvent, fpRect, fWind
: sysInit
filinit
'c key ' abort 16 + ! \ setup event driven key
\ ' File 'c fFcb ! \ establish nucleus based objects - filinit does this
' Event 'c fEvent !
' Rect 'c fpRect !
' Window 'c fWind !
<[ 4 ]> 'cfas null null cls null actions: fWind
myDoc title: fWind
grayRgn true setGrow: fWind
eventInit ;
: clean2 alive: fWind IF set: fWind THEN initfont clean1 upCase ;
: Demit sp@ 3+ 1 write: fFcb drop (emit) ;
: Dtype 2dup write: fFcb drop (type) ;
: Dcr 13 sp@ 3+ 1 write: fFcb 2drop (cr) ;
: ErrLog
'c Demit -> emitvec
'c Dtype -> typevec
'c Dcr -> crvec
" ErrLog" name: fFcb
create: fFcb 0=
IF .s clean2
txType saveSig set: fFcb
close: fFcb drop
THEN
0 -> emitvec
0 -> typevec
0 -> crvec
;
'c sysInit -> objInit
'c clean2 -> abortvec